package com.toommi.refuse.common.enums;

/**
 * ..
 * 正确错误状态枚举
 *
 * @author yangg
 * @since 2019-08-01 11:01
 */
public enum YNStatusEnum {

    /**
     * 待判断
     */
    WAITING(1, "待判断"),
    /**
     * 正确
     */
    YES(2, "正确"),
    /**
     * 错误
     */
    NO(3, "错误");


    /**
     * 标识
     */
    private int code;
    /**
     * 状态说明
     */
    private String note;

    public int getCode() {
        return code;
    }

    public String getNote() {
        return note;
    }

    YNStatusEnum(int code, String note) {
        this.code = code;
        this.note = note;
    }

    public static boolean hasValue(int code) {
        for (YNStatusEnum statusEnum : YNStatusEnum.values()) {
            if (statusEnum.getCode() == code) {
                return true;
            }
        }
        return false;
    }
}
